package com.easy.stock.dao;

import com.easy.stock.domain.StockRate;

public class StockRateDao extends BaseDao {
	
	public void addRate(StockRate rate) {
		
		String query = "{stock_id:\"" + rate.getStock_id() 
				+ "\",firm:\"" + rate.getFirm()
				+ "\",time:# },"
				+ "{action:\"" + rate.getAction()
				+ "\",rating:\"" + rate.getRating()
				+ "\",target_price:\"" + rate.getTarget_price()
				+ "\"}";
		
		getCollection().update(query, rate.getTime()).upsert().with(rate);
	}
}
